<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jspf/must/basePath.jspf" %>
<!--后台UI组件Start-->
<%@include file="/WEB-INF/jspf/zj/ligerui/LigerUI.jspf" %>
<%@include file="/WEB-INF/jspf/zj/ligerui/LigerUI_form.jspf" %>
<!--后台UI组件End-->

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <script src="dc_manager/base/food/series/lookup/SeriesLookUp.js" type="text/javascript"></script>
        <script src="dc_manager/base/unit/lookup/UnitLookUp.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $.metadata.setType("attr", "validate");
                var ini_Series = f_dcBaseFoodSeries("series_id2", "series_id", 200, 400, 100);
                var ini_Unit = f_dcBaseUnit("unit_id2", "unit_id", 200, 400, 100);
//                alert("${FOOD.series_id}"+"//"+"${FOOD.series_name}");
                ini_Series.setValue("${FOOD.series_id}");
                ini_Series.setText("${FOOD.series_name}");
                ini_Unit.setValue("${FOOD.unit_id}");
                ini_Unit.setText("${FOOD.unit_name}");
                
                var v = $("#Food_formID").validate({
                    debug: false,
                    errorPlacement: function(lable, element) {
                        if (element.hasClass("l-textarea")) {
                            element.addClass("l-textarea-invalid");
                        }
                        else if (element.hasClass("l-text-field")) {
                            element.parent().addClass("l-text-invalid");
                        }
                    },
                    success: function(lable) {
                        var element = $("#" + lable.attr("for"));
                        if (element.hasClass("l-textarea")) {
                            element.removeClass("l-textarea-invalid");
                        }
                        else if (element.hasClass("l-text-field")) {
                            element.parent().removeClass("l-text-invalid");
                        }
                    },
                    submitHandler: function() {
                        f_ajaxForm("Food_divID", "weixinkeji/dev/dc/base/food/adu/update.imy", 400, 200);
                        return false;
                    }
                });
                var OBJ_FORM = $("#Food_formID").ligerForm();
            });
        </script>
        <style type="text/css">
            body{ font-size:12px;}
            .l-table-edit {}
            .l-table-edit-td{ padding:4px;}
            .l-button-submit,.l-button-test{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
            .l-verify-tip{ left:230px; top:120px;}
        </style>
    </head>
    <body style="padding:10px">
        <div id="Food_divID">
            <form name="form" method="post"  id="Food_formID">
                <input type="hidden" name="food_id" value="${FOOD.food_id}" id="food_id" />
                <table cellpadding="0" cellspacing="0" class="l-table-edit" >
                    <tr>
                        <td align="right" class="l-table-edit-td">系列:</td>
                        <td align="left" class="l-table-edit-td" style="width:160px">
                            <input type="text" name="series_id2" value="${FOOD.series_id}" id="series_id2" validate="{required:true,minlength:1}" maxlength="26" ltype="text"/>
                        </td><td align="left"></td>
                    </tr>
                     <tr>
                        <td align="right" class="l-table-edit-td">编号:</td>
                        <td align="left" class="l-table-edit-td" style="width:160px">
                            <input type="text" name="food_code" value="${FOOD.food_code}" id="food_code" validate="{required:true,minlength:1}" ltype="text"/>
                        </td><td align="left"></td>
                    </tr>
                    <tr>
                        <td align="right" class="l-table-edit-td">名称(26字内):</td>
                        <td align="left" class="l-table-edit-td" style="width:160px">
                            <input type="text" name="food_name" value="${FOOD.food_name}" id="food_name" validate="{required:true,minlength:1}" maxlength="26" ltype="text"/>
                        </td><td align="left"></td>
                    </tr>
                    <tr>
                        <td align="right" class="l-table-edit-td">单位:</td>
                        <td align="left" class="l-table-edit-td" style="width:160px">
                            <input type="text" name="unit_id2" value="${FOOD.unit_id}" id="unit_id2" validate="{required:true,minlength:1}" maxlength="26" ltype="text"/>
                        </td><td align="left"></td>
                    </tr>
                    <tr>
                        <td align="right" class="l-table-edit-td">价格:</td>
                        <td align="left" class="l-table-edit-td" style="width:160px">
                            <input type="text" name="food_price" value="${FOOD.food_price}" id="food_price" validate="{required:true,minlength:1}" ltype="text"/>
                        </td><td align="left"></td>
                    </tr>
                    <tr style=" height: 100px;">
                        <td></td>
                        <td>
                            <input type="submit" value="提交" id="Button1" class="l-button l-button-submit" /> 
                        </td><td></td>
                    </tr>
                </table>
                <br />
            </form>
        </div>
    </body>
</html>
